﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.ObjectModel;
using BitcoinMarket.DataConnectors;

namespace BitcoinMarket.ViewModels
{
    public class NetworkStatusChartDetailViewModel : INotifyPropertyChanged
    {
        private string _chartName;
        private string _YAxisTitle;
        private string _ChartDescription;
        private double _Min, _Max;
        Collection<BlockChainChartsDataItem> _chartData;

        public NetworkStatusChartDetailViewModel()
        {
        }

        /// <summary>
        /// A collection for ItemViewModel objects.
        /// </summary>
        public Collection<BlockChainChartsDataItem> Data { get; private set; }

        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string ChartName
        {
            get
            {
                return _chartName;
            }
            set
            {
                if (value != _chartName)
                {
                    _chartName = value;
                    NotifyPropertyChanged("ChartName");
                }
            }
        }

        public string YAxisTitle
        {
            get
            {
                return _YAxisTitle;
            }
            set
            {
                if (value != _YAxisTitle)
                {
                    _YAxisTitle = value;
                    NotifyPropertyChanged("YAxisTitle");
                }
            }
        }

        public string ChartDescription
        {
            get
            {
                return _ChartDescription;
            }
            set
            {
                if (value != _ChartDescription)
                {
                    _ChartDescription = value;
                    NotifyPropertyChanged("ChartDescription");
                }
            }
        }

        public double Min
        {
            get
            {
                return _Min;
            }
            set
            {
                if (value != _Min)
                {
                    _Min = value;
                    NotifyPropertyChanged("Min");
                }
            }
        }

        public double Max
        {
            get
            {
                return _Max;
            }
            set
            {
                if (value != _Max)
                {
                    _Max = value;
                    NotifyPropertyChanged("Max");
                }
            }
        }

        public Collection<BlockChainChartsDataItem> ChartData
        {
            get
            {
                return _chartData;
            }
            set
            {
                if (value != _chartData)
                {
                    _chartData = value;
                    NotifyPropertyChanged("ChartData");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
